#!/usr/bin/env bash

script_dir=`dirname $0`
source "${script_dir}"/common

echo
info "Removing the patch"

echo
info "Removing additional files"
for additional_file in ${additional_files[@]}
do
    if test -e "${additional_file}"; then
        info "Removing ${additional_file}"
        rm -r "${additional_file}" 
    else
        warn "${additional_file} not found! Skipping"
    fi
done

echo
info "Restoring game file backups"
for game_file in ${game_files[@]}
do
    if test -f "${game_file}.bak"; then
        info "Restoring ${game_file}"
        rm "${game_file}"
        mv "${game_file}.bak" "${game_file}"
    else
        warn "Backup for ${game_file} not found! Skipping"
    fi
done

echo
info "Done"

echo
warn "The uninstaller does not remove logging servers from /etc/hosts. Please remove them manually"

echo
